﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyBoss1Core : EnemyBaseFixed
{
    public Camera followCamera;
    private CameraLevel1 scene1;
    private void Awake()
    {
        base.Init();
        if (followCamera == null)
        {
            followCamera = Camera.main;
        }
        scene1 = followCamera.GetComponent<CameraLevel1>();

    }

    void Start()
    {
        //Run();
        Stop();

    }
    private void FixedUpdate()
    {
        base.CommonFixedUpdate();
    }

    protected override void UpdateStateDie(bool stateChanged, EnumState inState, out EnumState outState)
    {
        base.UpdateStateDie(stateChanged, inState, out outState);
        if (stateChanged)
        {
            scene1.BossBoom();
            Destroy(gameObject);
        }
    }

    public override void OnTriggerEnter2D(Collider2D collision)
    {
        if (Utility.IsPlayerLayer(collision.gameObject))
        {
            scene1.StartBoss();
        }
    }
}
